
import GlobalEvent from "../../../cfw/event/GlobalEvent";
import { EventName } from "../../../public/Config";
import CookeryRoomStep from "./CookeryRoomStep";
const { ccclass, property } = cc._decorator;

@ccclass
export default class CookeryRoomStep5 extends CookeryRoomStep {

    @property(cc.Node)
    light: cc.Node = null;


    @property(cc.Node)
    qie: cc.Node = null;

    @property(cc.Node)
    top: cc.Node = null;

    @property(cc.Node)
    bottom: cc.Node = null;

    start() {
        this.node.active = true;
        // cc.tween(this.light).by(5, { angle: 360 }).repeatForever().start();
        cc.tween(this.qie).repeat(10, cc.tween(this.qie).by(0.5, { x: 30, y: 30 }).by(0.5, { x: -30, y: -30 })).start();
        cc.tween(this.top).by(0.5, { y: -this.top.height }).start();
        cc.tween(this.bottom).by(0.5, { y: this.top.height }).start();
        cc.tween(this.node).to(3, {}).call(this.finish.bind(this)).start()
    }


    finish() {
        cc.log(' finish == ')
        GlobalEvent.instance().emit(EventName.UPDATE_COOKIE_STEP,5)
    }


}
